﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once        
#include "IFamilyConstraint.h"
#include "GmFamilyService.h"


namespace gfam
{
    class IFamilyParameterDefinition;

    /// \brief  尺寸约束类
    class GM_FAMILY_SERVICE_EXPORT IFamilyDimensionConstraint : public IFamilyConstraint
    {
        DEFINE_CAST_DERIVED(gfam::IFamilyDimensionConstraint, gfam::IFamilyConstraint)
    public:

        /// \brief 设置尺寸值
        ///
        /// \param value 尺寸值
        virtual void SetDimensionValue(double value) = 0;

        /// \brief 获取尺寸值
        ///
        /// \return 尺寸值
        virtual double GetDimensionValue()  const = 0;

        /// \brief 获取尺寸值的关联更新id
        ///
        /// \return 尺寸值的关联更新id
        virtual RegenDataId GetDimensionValueRdId()  const = 0;

        /// \brief 设置坐标
        ///
        /// \param position 坐标
        /// \return 
        virtual void SetPosition(const gcmp::Vector3d& position) = 0;

        /// \brief 获取坐标
        ///
        /// \return 当前坐标
        virtual gcmp::Vector3d GetPosition() const = 0;

        /// \brief 获取坐标的关联更新id
        ///
        /// \return 关联更新id
        virtual RegenDataId GetPositionRdId() const = 0;


        /// \brief 设置绑定参数
        ///
        /// \param sourceId 源对象id
        /// \param parameterDefinitionId 参数定义id
        /// \return 设置成功返回true,否则返回false
        virtual bool SetBindingParameter(const gcmp::ElementId& sourceId, Int32 parameterDefinitionId) = 0;

        /// \brief 取消绑定参数
        ///
        /// \return void
        virtual void CancelBindingParameter() = 0;

        /// \brief 获取绑定的源对象id
        ///
        /// \return 源对象id
        virtual gcmp::ElementId GetBindingSourceId() const = 0;


        /// \brief 获取绑定的参数定义id
        ///
        /// \return 参数定义id
        virtual Int32 GetBindingParameterDefinitionId() const = 0;

        /// \brief 获取绑定参数关联更新id
        ///
        /// \return  关联更新id
        virtual RegenDataId GetBindingParameterRdId() const = 0;

        /// \brief 设置绑定的族参数定义id
        ///
        /// \param familyParameterDefinitionId 族参数定义id
        /// \return 
        virtual void SetFamilyParameterDefinitionId(const gcmp::ElementId& familyParameterDefinitionId) =0;

        /// \brief 获取绑定的族参数定义id
        ///
        /// \return  族参数定义id
        virtual gcmp::ElementId GetFamilyParameterDefinitionId() const = 0;

        /// \brief 获取绑定的族参数定义关联更新id
        ///
        /// \return  关联更新id
        virtual RegenDataId GetFamilyParameterDefinitionIdRdId() const = 0;

        /// \brief 获取绑定的族参数定义
        ///
        /// \return  绑定的族参数定义
        virtual const IFamilyParameterDefinition* GetFamilyParameterDefinition() const = 0;

        /// \brief 获取标注对应的字符串，包括标注参数和标注值
        ///
        /// \return  对应的字符串
        virtual std::wstring GetDimensionString() const = 0;

    };
}